# !/usr/bin/env python
# -*- coding: utf-8 -*-
# @File  : 工具创建-@tool 装饰器(文档字符串解析).py
# @Author: dongguangwen
# @Date  : 2025-03-23 21:19
from langchain_core.tools import tool


@tool(parse_docstring=True)
def foo(bar: str, baz: int) -> str:
    """The foo.

    Args:
        bar: The bar.
        baz: The baz.
    """
    return bar


ret = foo.args_schema.schema()
print(ret)

"""
{'description': 'The foo.', 'properties': {'bar': {'description': 'The bar.', 'title': 'Bar', 'type': 'string'}, 'baz': {'description': 'The baz.', 'title': 'Baz', 'type': 'integer'}}, 'required': ['bar', 'baz'], 'title': 'foo', 'type': 'object'}
"""